package com.fili.core;

import com.fili.core.serial.SerialConsumer;
import com.fili.core.storage.StorageContainer;
import com.fili.core.storage.StorageItem;
import com.fili.gui.view.DataView;

/**
 * Created by Claudiu-Florin FILIMON
 * Date: Oct 14, 2006
 * Time: 1:53:51 PM
 */
public class DataLinker implements SerialConsumer
{
    private int dryID;
    private StorageContainer storageContainer;
    private DataView dataView;


    public DataLinker(int dryID, StorageContainer storageContainer, DataView dataView)
    {
        this.dryID = dryID;
        this.storageContainer = storageContainer;
        this.dataView = dataView;

        dataView.setID(dryID);
    }

    public int getSerialID()
    {
        return dryID;
    }

    public void receiveSerialData(String s)
    {
        StorageItem item=null;
        storageContainer.addItem(item.clone());
        dataView.update(item);
    }
}
